<!--
 * @Description: 
 * @Autor: 商晓彬
 * @Date: 2021-08-27 10:53:42
 * @LastEditors: 商晓彬
 * @LastEditTime: 2021-12-09 16:06:06
-->
<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="son modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div style="width:1880px!important;margin: 1.75rem auto;">
        <div class="modal-content">
            <form style="height: 900px!important;overflow: auto;" *ngIf="active" #bopForm="ngForm" novalidate
                (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>Bom物料选择</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="modal-body" style="height: 680px!important;">
                        <div class="row align-items-center" style="margin-top: 25px;">
                            <div class="primeng-datatable-container">
                                <p-treeTable [value]="treeData" scrollHeight="600px" [scrollable]="true"
                                selectionMode="checkbox" [(selection)]="selectRow">
                                    <ng-template pTemplate="header">
                                        <tr>
                                            <th style="width: 80px;">选择</th>
                                            <th style="width: 200px">Bom层级</th>
                                            <th style="width: 150px">图号</th>
                                            <th style="width: 150px">名称</th>
                                            <th style="width: 150px">规格型号</th>
                                            <th style="width: 150px">单位</th>
                                            <th style="width: 150px">Bom用量</th>
                                            <th style="width: 150px">年代号</th>
                                            <th style="width: 150px">备注</th>
                                            <th style="width: 150px">Bom版本</th>
                                            <th style="width: 150px">属性</th>
                                            <th style="width: 150px">类别</th>
                                            <th style="width: 150px">细分类别</th>
                                            <th style="width: 150px">是否关键件</th>
                                            <th style="width: 150px">状态</th>
                                            <th style="width: 150px">创建人</th>
                                        </tr>
                                    </ng-template>
                                    <ng-template pTemplate="body" let-rowNode="$implicit" let-rowData="rowData">
                                        <tr [ttRow]="rowNode">
                                            <td style="width: 80px;">
                                                <p-treeTableCheckbox [value]="rowNode" [disabled]="rowData.materialPropertyName != '零件'"></p-treeTableCheckbox>
                                            </td>
                                            <td style="width: 200px">
                                                <p-treeTableToggler [rowNode]="rowNode"></p-treeTableToggler>
                                                {{rowData.levelNum}}
                                            </td>
                                            <td style="width: 150px">{{rowData.materialNo}}</td>
                                            <td style="width: 150px">{{rowData.materialName}}</td>
                                            <td style="width: 150px">{{rowData.model}}</td>
                                            <td style="width: 150px">{{rowData.unitName}}</td>
                                            <td style="width: 150px">{{rowData.unit1BomDosage}}</td>
                                            <td style="width: 150px">{{rowData.yearsNo}}</td>
                                            <td style="width: 150px">{{rowData.remark}}</td>
                                            <td style="width: 150px">{{rowData.versionNo}}</td>
                                            <td style="width: 150px">{{rowData.materialPropertyName}}</td>
                                            <td style="width: 150px">{{rowData.materialTypeName}}</td>
                                            <td style="width: 150px">{{rowData.materialSegmentationName}}</td>
                                            <td style="width: 150px">{{rowData.isKeyPart == 'False'? '否':'是'}}</td>
                                            <td style="width: 150px">{{selectStatus(rowData.status)}}</td>
                                            <td style="width: 150px">{{rowData.createUserName}}</td>
                                        </tr>
                                    </ng-template>
                                </p-treeTable>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer" style="justify-content: center;">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i>
                            <span>选择</span></button>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>